<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>采购报表</title>
    <style>
        table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
        }
        th, td {
            padding: 8px;
            text-align: left;
        }
    </style>
</head>
<body>

<h2>采购报表</h2>
<a class="button" href="http://localhost:8080/showreport2">费用分析报表</a>
<a class="button" href="http://localhost:8080/showreport3">供应商绩报表</a>
<a class="button" href="http://localhost:8080/login">退出</a>

<table>
    <tr>
        <th>订单编号</th>
        <th>供应商ID</th>
        <th>供应商姓名</th>
        <th>采购日期</th>
        <th>交货日期</th>
        <th>物品名称</th>
        <th>数量</th>
        <th>单价</th>
        <th>总价</th>
        <th>状态</th>
    </tr>

    <c:forEach items="${reports}" var="report">
        <tr>
            <td>${report.id}</td>
            <td>${report.supplierID}</td>
            <td>${report.supplierName}</td>
            <td><fmt:formatDate value="${report.purchaseDate}" pattern="yyyy-MM-dd"/></td>
            <td><fmt:formatDate value="${report.deliveryDate}" pattern="yyyy-MM-dd"/></td>
            <td>${report.productName}</td>
            <td>${report.productQuantity}</td>
            <td>${report.productUnitPrice}</td>
            <td>${report.productTotalPrice}</td>
            <td>${report.status}</td>
        </tr>
    </c:forEach>


</table>

</body>
</html>